<template>
	<div class="scroll-wrapper" ref="wrapper">
		<div class="scroll-content">
			<div v-if="showScrollwrapper">
				<no-data-tip v-show="
					(!searchDatas.viewDatas || searchDatas.viewDatas.length <= 0) &&
					(!searchDatas.foodDatas || searchDatas.foodDatas.length <= 0) &&
					(!searchDatas.hotelDatas || searchDatas.hotelDatas.length <= 0) &&
					(!searchDatas.massageDatas || searchDatas.massageDatas.length <= 0) &&
					(!searchDatas.ktvDatas || searchDatas.ktvDatas.length <= 0)
				"></no-data-tip>

				<div v-if="searchDatas.viewDatas && searchDatas.viewDatas.length > 0">
					<home-title title="景点结果:"></home-title>
					<view-list :viewDatas="searchDatas.viewDatas"></view-list>
				</div>

				<div v-if="searchDatas.foodDatas && searchDatas.foodDatas.length > 0">
					<home-title title="美食结果:"></home-title>
					<food-list :foodDatas="searchDatas.foodDatas"></food-list>
				</div>

				<div v-if="searchDatas.hotelDatas && searchDatas.hotelDatas.length > 0">
					<home-title title="酒店结果:"></home-title>
					<hotel-list :hotelDatas="searchDatas.hotelDatas"></hotel-list>
				</div>

				<div v-if="searchDatas.massageDatas && searchDatas.massageDatas.length > 0">
					<home-title title="按摩结果:"></home-title>
					<massage-list :massageDatas="searchDatas.massageDatas"></massage-list>
				</div>

				<div v-if="searchDatas.ktvDatas && searchDatas.ktvDatas.length > 0">
					<home-title title="ktv结果:"></home-title>
					<ktv-list :ktvDatas="searchDatas.ktvDatas"></ktv-list>
				</div>
			</div>

			<error :errorShow="searchDatas.status === -1"></error>
		</div>
	</div>
</template>

<script>
import BetterScroll from 'better-scroll';
import ViewList from './ViewList/Index';
import FoodList from './FoodList/Index';
import HotelList from './HotelList/Index';
import MassageList from './MassageList/Index';
import KtvList from './KtvList/Index';
import HomeTitle from './Sub/HomeTitle';
import NoDataTip from './Sub/NoDataTip';
import Error from './Sub/Error';


export default {
	name: 'SearchScrollWrapper',
	components: {
		HomeTitle,
		ViewList,
		FoodList,
		HotelList,
		MassageList,
		KtvList,
		NoDataTip,
		Error
	},
	props: {
		searchDatas: Object,
		showScrollwrapper:Boolean
	},
	mounted() {
		this.scroll = new BetterScroll(this.$refs.wrapper);
	}
}
</script>

<style lang="scss" scoped>

</style>
